package copy

class KotlinCopyTest {
    var name: String? = null
    var age: Int? = null
    var boy: Boolean? = null

    override fun toString(): String {
        return "KotlinCopyTest$${hashCode()} name = $name, age = $age, boy = $boy"
    }
}

fun main() {
    val test0 = KotlinCopyTest()

    println("test0 = $test0")

    val test1 = KotlinCopyTest()
    test1.name = test0.name
    test1.age = test0.age
    test1.boy = test0.boy

    println("test1 = $test1")

    test1.name = "小红"
    test1.age = 12
    test1.boy = false

    println("test0 = $test0")
    println("test1 = $test1")
}